const express = require("express");
const router = express.Router();
// const Shop = require("../../../controllers/shop.controller");
const Shop = require("../../../controllers/shop.controller");

// /**
//  * 查询店铺信息列表
//  * @route POST /api/public/web/shop/list
//  * @group 店铺信息（客户端） - list of shop
//  * @param {object} query - 请按固定查询规范
//  * @returns {object} 200 - An array of shop info
//  * @returns {object} 605 - 请求失败
//  * @returns {Error}  default - Unexpected error
//  */
// router.post("/list", Shop.findAll);

/**
 * 创建店铺信息
 * @route POST /api/private/shop/create
 * @group 店铺管理 - Operations about shop
 * @param {string} shop_name.query.required - 请输入店铺名称
 * @param {string} shop_desc.query.required - 请输入店铺描述
 * @param {string} shop_path - 请输入店铺路径
 * @returns {object} 200 - An array of shop info
 * @returns {object} 605 - 请求失败
 * @returns {Error}  default - Unexpected error
 */

router.post("/create", Shop.create);

/**
 * 删除店铺信息
 * @route POST /api/private/shop/delete
 * @group 店铺管理 - delete of shop
 * @param {number} id - 请输入店铺ID
 * @param {string} authorization - 请输入token
 * @returns {object} 200 - An array of shop info
 * @returns {object} 605 - 请求失败
 * @returns {Error}  default - Unexpected error
 */
router.post("/delete", Shop.delete);
/**
 * 查询店铺信息列表
 * @route POST /api/private/shop/list
 * @group 店铺管理 - list of shop
 * @param {object} query - 请按固定查询规范
 * @returns {object} 200 - An array of shop info
 * @returns {object} 605 - 请求失败
 * @returns {Error}  default - Unexpected error
 */
router.post("/list", Shop.findAll);
/**
 * 更新店铺信息列表
 * @route POST /api/private/shop/update
 * @group 店铺管理 - list of shop
 * @param {string} shop_name.query.required - 请输入店铺名称
 * @param {string} shop_desc.query.required - 请输入店铺描述
 * @returns {object} 200 - An array of shop info
 * @returns {object} 605 - 请求失败
 * @returns {Error}  default - Unexpected error
 */
router.post("/update", Shop.update);

/**
 * 删除全部店铺信息
 * @route POST /api/private/shop/deleteAll
 * @group 店铺管理 - list of shop
 * @returns {object} 200 - An array of shop info
 * @returns {object} 605 - 请求失败
 * @returns {Error}  default - Unexpected error
 */
router.post("/deleteAll", Shop.deleteAll);

module.exports = router;
